package com.refusea.train.domain.req

import com.refusea.train.domain.entity.ReferrerCommission
import java.time.LocalDate

/**
 * @author Zhang Yan 2024/4/25
 **/
data class ReferrerCommissionReq(
    var schoolId: Int?,
    var referrerId: Int,
    val start: LocalDate?,
    var end: LocalDate?,
    val cat: ReferrerCommission.Cat?,
    val paid: Boolean?,
    val page: Int,
) {
    var offset: Int = 0
    var limit: Int = 10


    fun calculateOffset(limit: Int) {
        this.offset = (this.page.coerceAtLeast(1) - 1) * limit
        this.limit = limit
    }

}
